import request from '@/utils/request'
// 带参数获取文章列表sssssssssssssssssss
export const getArticleListAPI = ({ page, pageSize, cateId, state }) => {
  return request({
    url: `/api/article?page=${page}&pageSize=${pageSize}&cateId=${cateId}&state=${state}`,
    method: 'get'

  })
}
// 不带参数获取所有文章信息
export const getAllReservationAPI = () => {
  return request({
    method: 'GET',
    url: '/api/article'
  })
}
// 新增文章
// 上传文章的接口
export const uploadArticleAPI = (fd) => {
  return request({
    url: '/api/article',
    method: 'POST',
    data: fd,
    headers: {
      'Content-Type': 'multipart/form-data' // 设置请求头
    }
  })
}
// 通过文章id获取详细信息的接口
export const getArtDetailAPI = (artId) => {
  return request({
    url: `/api/article/${artId}`,
    method: 'GET'
  })
}
// 通过id删除文章
export const deleteArtDetailAPI = (artId) => {
  return request({
    url: `/api/article/${artId}`,
    method: 'DELETE'
  })
}
